package base.day05;

public class Study5 {
    public static void main(String[] args) {
        //求1000以内的奇数和
        int sum = 0;
        int i = 1;
        while (i < 1000) {
            if (i % 2 != 0) {
                sum += i;
            }
            i++;
        }
        System.out.println("1000内所有奇数和等于：" + sum);
    }
}
